package com.example.administrator.managesystem.activity.my_profile;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.example.administrator.managesystem.R;
import com.example.administrator.managesystem.base.BaseActivity;
import com.example.administrator.managesystem.fragment.myprofile.collect.MyCollectCircleFragment;
import com.example.administrator.managesystem.fragment.myprofile.collect.MyCollectWikiFragment;
import com.flyco.tablayout.SlidingTabLayout;
import com.umeng.socialize.UMShareAPI;

import java.util.ArrayList;

/**
 * Created by Administrator on 2019/1/7.
 */

public class MyCollectActivity extends BaseActivity {
    private ViewPager viewPager;
    private ArrayList<Fragment> fragments = new ArrayList<>();
    private SlidingTabLayout slidingTabLayout;
    @Override
    public void initView() {
        showfloatButton(true,true);
        slidingTabLayout =  findViewById(R.id.tab_layout);
        viewPager = findViewById(R.id.viewpager);
    }

    @Override
    public void doBusiness() {
        fragments.add(new MyCollectWikiFragment());
        fragments.add(new MyCollectCircleFragment());
        slidingTabLayout.setViewPager(viewPager,new String[]{"农业科普","我发的圈"},this,fragments);

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_my_collect;
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
    }
}
